<%@page import="org.springframework.web.context.request.SessionScope"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@	page import="kau.dao.*"%>
<%@	page import="kau.vo.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>회원탈퇴</title>
<script type="text/javascript">
	function mainSubmit() {
		var pwd = fm.password.value; //입력한 패스어ㄷ워드
		var pw = fm.pw.value; // 기존 패스워드
		var custLevel = fm.custLevel.value;
		if (confirm("정말로 탈퇴하시겠습니까?")) {
			if (custLevel == "1") {
				alert('관리자계정은 삭제할 수 없습니다.');
				return false;
			} else if (pwd == '') {
				alert('비밀번호를 입력하세요.');
				return false;
			} else if (pwd == pw) {
				return true;
			} else {
				alert('비밀번호를 확인하세요.');
				return false;
			}
		} else
			return false;
	}
</script>
<style type="text/css">
#info {
	font-family: '맑은고딕', dotum, sans-serif, bold;
	font-size: 13px
}
</style>

<style type="text/css">
<!--
@import url("/nems/css/style.css");
-->
</style>

</head>
<body>



	<%
		String custId = (String) session.getAttribute("custId");
		String pw = CustomerDAOImpl.getInstance().getCustomer(custId)
				.getPassword();
		int custLevel = CustomerDAOImpl.getInstance().getCustomer(custId)
				.getCustLevel();
	%>





	<div style="margin-left: 20px" id="info">
		<div class="content_header">
			<br>
			<table align="left">
				<tr>

					<td><img src="/nems/cust/img/deleteImg.png" width="40" /></td>
					<td>
						<h4
							style="font-weight: bold; color: #005700; text-align: left; font-size: 20px;">회원탈퇴</h4>
					</td>

				</tr>


			</table>

			<center>
				<br> <br> <br> <br>
				<p>회원탈퇴를 진행하기 위해 패스워드 확인이 필요합니다.</p>
				<br> <strong>비밀번호를 입력해주세요.</strong> <br> <br>
			</center>


		</div>
		<div class="section">
			<form name="fm" method="post" action="./delete_self.cust"
				onsubmit="return mainSubmit();">
				<input type="hidden" name="custId" value="<%=custId%>" /> <input
					type="hidden" name="pw" value="<%=pw%>"> <input
					type="hidden" name="custLevel" value="<%=custLevel%>">
				<div class="delete">


					<table width="600" border="0">
						<tr>
							<td colspan="2">
								<hr width="670">
							</td>

						</tr>
						<tr align="center">
							<td width="300" height="40">아이디</td>
							<td width="300">${sessionScope.custId}</td>
						</tr>
						<tr align="center">
							<td width="300" height="40">비밀번호</td>
							<td><input type="password" name="password" /></td>
						</tr>

						<tr>
							<td colspan="2">
								<hr width="670"> <br>
							</td>
						</tr>
						<tr align="center">
							<td colspan="2"><img src="/nems/cust/img/deleteSubmsg.png"><br>
							</td>
						</tr>
						<tr align="center">
							<td colspan="2">
								<div class="btn_area" style="padding-top: 50px">
									<!-- 	<input name="" type="image" src="/nems/img/btn_confirm.gif"
										alt="확인" />
 -->
									<button class="positive" style="width: 70px" type="submit"
										onclick="return mainSubmit()">
										<img src="cust/img/shopping_cart_accept.png"
											style="width: 20px; height: 10px" />확인
									</button>
								</div>
							</td>
						</tr>
					</table>


					<br> <br> <br>
				</div>


			</form>
		</div>
	</div>

</body>
</html>